package lwf.web.struts.action.admin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import lwf.handler.IProcessHandler;
import lwf.web.struts.action.BaseAction;
import lwf.web.struts.action.form.admin.FeedBackActionForm;

import net.lwf.email.EmailNotification;
import net.lwf.service.LwfService;
import net.lwf.web.constant.IPageTitle;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;



public class FeedBackAction extends BaseAction {
	
	public ActionForward home(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return mapping.findForward("home");
	} //home
	
	public ActionForward send(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		FeedBackActionForm fbaform = (FeedBackActionForm) form;
		if(!LwfService.disableMail()) {
			EmailNotification.sendFeedbackMail(getWebUser(request).getUser().getUserId(), fbaform.getComments());
		}
		return mapping.findForward("thankyou");
	} //send

	@Override
	public IProcessHandler getHandler(HttpServletRequest request) {
		return null;
	}

	@Override
	public String getPageTitle() {
		return IPageTitle.FEED_BACK;
	}

	@Override
	public String getMainTitle() {
		return null;
	}

	@Override
	public String getPdfLink() {
		return null;
	}

	@Override
	public String getQuizLink() {
		return null;
	}

}
